﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication3
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        private string password = "";
        private string username = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            tbxUserName.Text = Request.Params["username"];
            password = Request.Params["password"];
            username = Request.Params["username"];
        }

        protected void btnCommit_Click(object sender, EventArgs e)
        {
            if (tbxUserName.Text == username && tbxPassword.Text == password)
            {
                Literal1.Text = "登陆成功";
                Session.Add("username", username);
                Response.Redirect("WebForm3.aspx");
            }
            else 
            {
                Literal1.Text = "用户名或密码不正确";
            }
        }
    }
}